// Package router
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2023 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
package router

import (
	"context"
	"hotgo/internal/consts"
	"hotgo/internal/controller/api/auction"
	"hotgo/internal/controller/api/auction_bid"
	"hotgo/internal/controller/api/card"
	"hotgo/internal/controller/api/common"
	"hotgo/internal/controller/api/member"
	"hotgo/internal/controller/api/operation"
	"hotgo/internal/controller/api/order"
	"hotgo/internal/controller/api/pay"
	"hotgo/internal/controller/api/product"
	"hotgo/internal/controller/api/receiveraddress"
	"hotgo/internal/controller/api/store"
	"hotgo/internal/controller/api/wallet"
	"hotgo/internal/service"
	"hotgo/utility/simple"

	"github.com/gogf/gf/v2/net/ghttp"
)

// Api 前台路由
func Api(ctx context.Context, group *ghttp.RouterGroup) {
	group.Group(simple.RouterPrefix(ctx, consts.AppApi), func(group *ghttp.RouterGroup) {
		group.Bind(
			pay.NewV1(), // 支付异步通知
		)
		group.Bind(
			auction.NewV1(),
		)
		group.Middleware(service.Middleware().ApiAuth)
		group.Bind(
			member.NewV1(),          // 管理员
			order.NewV1(),           // 订单
			operation.NewV1(),       // 运营
			product.NewV1(),         // 商品
			common.NewV1(),          // 上传
			auction_bid.NewV1(),     // 拍卖出价
			card.NewV1(),            // 免单卡激活
			store.NewV1(),           // 门店
			wallet.NewV1(),          // 钱包
			receiveraddress.NewV1(), // 收货地址
		)
	})
}
